/**
 * Copyright (C), 2020-2021 by colley.ma
 * File Name: SwakKnife4jProperties.java
 * Encoding: UTF-8
 * Date: 2021年11月3日 下午1:34:17
 * History:
*/
package com.swak.frame.swagger.config;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.github.xiaoymin.knife4j.core.extend.OpenApiExtendSetting;
import com.github.xiaoymin.knife4j.core.model.MarkdownProperty;
import com.github.xiaoymin.knife4j.spring.configuration.Knife4jHttpBasic;
import com.swak.frame.SwakConstants;

@ConfigurationProperties(prefix = SwakConstants.SWAK_SWAGGER)
public class SwakKnife4jProperties {

	/**
	 * 是否开启Knife4j增强模式
	 */
	private boolean enable = false;
	/**
	 * 是否开启默认跨域
	 */
	private boolean cors = false;

	/**
	 * 是否开启BasicHttp验证
	 */
	private Knife4jHttpBasic basic;

	/**
	 * 是否生产环境
	 */
	private boolean production = false;

	/**
	 * 个性化配置
	 */
	private OpenApiExtendSetting setting;

	private SwakApiInfo info;

	/**
	 * 分组文档集合
	 */
	private List<MarkdownProperty> documents;

	public Knife4jHttpBasic getBasic() {
		return basic;
	}

	public void setBasic(Knife4jHttpBasic basic) {
		this.basic = basic;
	}

	public boolean isProduction() {
		return production;
	}

	public void setProduction(boolean production) {
		this.production = production;
	}

	public List<MarkdownProperty> getDocuments() {
		return documents;
	}

	public void setDocuments(List<MarkdownProperty> documents) {
		this.documents = documents;
	}

	public OpenApiExtendSetting getSetting() {
		return setting;
	}

	public void setSetting(OpenApiExtendSetting setting) {
		this.setting = setting;
	}

	public boolean isCors() {
		return cors;
	}

	public void setCors(boolean cors) {
		this.cors = cors;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public SwakApiInfo getInfo() {
		return info==null? new SwakApiInfo():info;
	}

	public void setInfo(SwakApiInfo info) {
		this.info = info;
	}

}
